package com.app.oasystem.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @author 86+
 * @data 2021-04-13
 */

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class User implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "Id", type = IdType.AUTO)
    private Integer Id;

    @TableField("username")
    private String username;

    private String password;

    private String nickname;

    private Integer age;

    /**
     * 0男1女
     */
    private Integer sex;

    private String phone;

    private String address;

    /**
     * 0管理员1普通用户
     */
    private Integer role;

    private String mail;

    private String mailpwd;

    /**
     * 最近一次登录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("loginTime")
    private Date loginTime;

    /**
     * 登录次数
     */
    @TableField("loginCount")
    private String loginCount;
    /**
     * 对于QQ邮箱需要凭证用来发送邮件
     */
    private String voucher;


}
